home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 July
/
Macworld (1999-07).dmg
/
Shareware World
/
Comms & Internet
/
OpenScript 1.6.1
/
MacPerl ƒ
/
unregistered.script
< prev
next >
Wrap
Text File
|
1999-04-08
|
899b
|
51 lines
<html>
<head>
<title>OpenScript test</title>
</head>
<body>
<h1>MacPerl example:</h1>
<HR>
<BR><BR>
First script: Processor
<BR><BR>
<AppleScript>
tell application "MacPerl"
return ¬
"You are using a " & (Do Script "
#!perl -w
use Mac::Gestalt;
my($arch, %archs, $mac);
$arch= $Gestalt{gestaltSysArchitecture()};
%archs = (gestaltPowerPC() => 'Motorola PowerPC',gestalt68k()=> 'Motorola 68k');
$mac= (defined($archs{$arch}) ?
$archs{$arch}: 'an unknown');
MacPerl::Reply($mac);
") & " processor."
end tell
</AppleScript>
<BR><BR>
Second script: Year 2000
<BR><BR>
<AppleScript>
tell application "MacPerl"
return ¬
"Days until the year 2000: " & (Do Script "
use Time::Local;
$d1 = timelocal(0,0,0,1,0,100);
$d2 = ($d1 - time()) / 60 / 60 / 24;
MacPerl::Reply(int($d2))
")
end tell
</AppleScript>
<HR>
</body>
</html>